#ifndef AUX_THREAD_H
#define AUX_THREAD_H
#ifdef __cplusplus
extern "C" {
#endif
#include "config.h"

#ifdef PLATFORM_WIN
#include "win_thread.h"
#else
#ifdef PLATFORM_LINUX
#include <pthread.h>
#include "linux_thread.h"
#endif
#endif

typedef enum {
    THREAD_READY = 0,
    THREAD_RUNNING,
    THREAD_BLOCKING,

    THREAD_START_THREAD_FUNCTION_FAIL,
    THREAD_EXIT_DUE_TO_PARAMETER_ERROR,
    THREAD_EXIT_DUE_TO_WORK_ERROR,
    THREAD_EXIT_DUE_TO_EXTERNAL_EXIT_FLAG,
    THREAD_EXIT_DUE_TO_REMOTELOST,

    THREAD_DEAD_DUE_TO_FINISH
} ExIPCThreadState;

#define isThreadDead(st) \
    (((st) != THREAD_READY) && \
     ((st) != THREAD_RUNNING) && \
     ((st) != THREAD_BLOCKING))
#ifdef __cplusplus
}
#endif
#endif
